#ifndef __MEM_H__
#define __MEM_H__
#include "../model.h"
#include "tracer/mtracer.h"
#include "config.h"

#ifdef __cplusplus
extern "C" {
#endif

#define PMEM_LEFT  ((uint64_t)CONFIG_MBASE)
#define PMEM_RIGHT ((uint64_t)CONFIG_MBASE + CONFIG_MSIZE - 1)
#define RESET_VECTOR (PMEM_LEFT)
void init_mem();
long long pmem_read(long long raddr, char rsize, char is_icache);
void pmem_write(long long waddr, long long wdata, char wmask);
uint8_t *guest_to_host(uint64_t paddr);
long load_img(char *img_file);

#ifdef __cplusplus
}
#endif
#endif
